﻿using System;
using System.Collections.Generic;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Represents the head of an HTML document, containing metadata about it.
    /// </summary>
    [Serializable]
    public class Head : Element {
        private ICollection<string> _profile;

        /// <summary>
        /// Constructs a new Head section.
        /// </summary>
        public Head() {
            _profile = new LinkedList<string>();
        }

        /// <summary>
        /// Gets a collection of the profiles represented by this head section.
        /// </summary>
        [Obsolete("Deprecated in HTML5.")]
        public ICollection<string> Profile {
            get { return _profile; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _profile, "profile", ' ');
        }
    }
}
